package com.dragon.refect.classload;

/**
 * 当一个类实现了一个接口，类被初始化时，并不会先去初始化其父接口
 *
 * @author dragon
 * @since 2019/11/18
 */
public class MyTest4 {

    public static void main(String[] args) {
        System.out.println(MyChild.THREAD2);
    }
}


interface MyParent {

    public static final int b = 100;

    public static final Thread THREAD = new Thread() {
        // 构造代码块，当创建对象时，会被执行
        {
            System.out.println("myParent thread constructor block init");
        }
    };
}

class MyChild implements MyParent {

    public static int a = 10;

    public static final Thread THREAD2 = new Thread() {
        // 构造代码块，当创建对象时，会被执行
        {
            System.out.println("myChild thread constructor block init");
        }
    };

}
